<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserTable extends Migration
{
    /**
     * 用户账号
     */
    public function up(): void
    {
        Schema::create('user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('user_name', 30)->default('')->comment('用户名');
            $table->string('pwd', 200)->default('')->comment('密码');
            $table->string('phone', 15)->default('')->comment('手机号');
            $table->string('im_account', 50)->default('')->comment('IM账号');
            $table->string('im_token', 500)->default('')->comment('IM登录token');
            $table->string('version', 15)->default('')->comment('APP版本号');
            $table->string('device_id', 50)->default('')->comment('设备ID');
            $table->string('device', 200)->default('')->comment('设备信息');
            $table->string('client_ip', 10)->default('')->comment('IP');
            $table->tinyInteger('platform')->default(1)->comment('平台：1-ios,2-android');
            $table->string('android_market', 20)->default('')->comment('安卓应用市场');
            $table->tinyInteger('status')->default(0)->comment('状态：0-有效，1-冻结，2-注销');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
    }
}
